package com.dxt.rabbitmq.service.topic;

import com.dxt.rabbitmq.config.TopicModeConfig;
import com.dxt.rabbitmq.vo.TestMessage;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TopicModePublisher {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void publish(TestMessage testMessage){
        rabbitTemplate.convertAndSend(TopicModeConfig.EXCHANGE, "topic.msg.one", testMessage);
    }
}
